package shuai5.convert;

import java.util.Map;

import org.apache.struts2.util.StrutsTypeConverter;

import shuai5.entity.Point;

public class PointConversion extends StrutsTypeConverter {

	
	public Object convertFromString(Map context, String[] values, Class toClass) {
		String[] pointValues=values[0].split(",");
		int x=Integer.parseInt(pointValues[0]);
		int y=Integer.parseInt(pointValues[1]);
		Point point=new Point();
		point.setX(x);
		point.setY(y);
		return point;
	}

	
	public String convertToString(Map context, Object o) {
		return null;
	}

}
